package com.fly.platform.base.pojo

import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableName
import com.fasterxml.jackson.annotation.JsonFormat
import com.fly.platform.common.constant.CommonConstant
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import org.springframework.format.annotation.DateTimeFormat
import java.util.*

@TableName("base_user")
@ApiModel("用户表")
data class User(

        @ApiModelProperty("登录名")
        var username: String? = null,

        @ApiModelProperty("密码")
        var password: String? = null,

        @ApiModelProperty("昵称")
        var nickname: String? = null,

        @ApiModelProperty("手机号")
        var mobile: String? = null,

        @ApiModelProperty(value = "邮箱")
        var email: String? = null,

        @ApiModelProperty(value = "区域id")
        @TableField(value = "area_id")
        var areaId: String? = null,

        @ApiModelProperty(value = "街道地址")
        var street: String? = null,

        @ApiModelProperty(value = "性别")
        @TableField(value = "sex")
        var sex: String? = null,

        @ApiModelProperty(value = "用户头像")
        var avatar: String = CommonConstant.USER_DEFAULT_AVATAR,

        @ApiModelProperty(value = "状态 默认0正常 -1拉黑")
        var status: Int = CommonConstant.USER_STATUS_NORMAL,

        @ApiModelProperty(value = "描述/详情/备注")
        var description: String? = null,

        @ApiModelProperty(value = "所属部门id")
        @TableField(value = "department_id")
        var departmentId: String? = null,

        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        @ApiModelProperty(value = "生日")
        var birth: Date? = null

) :BasePojo() {

    companion object {
        const val serialVersionUID = 1L
    }
}